package com.hushao.aimi.common;


import lombok.Data;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * @description: 分页
 * @author: 胡少
 * @create: 2018-06-08 12:26
 **/
@Data
public class PageVo {
    //页数
    private Integer totalPages;
    //第几页
    private Integer number;
    //大小
    private Integer size;
    //总共有多少条数据
    private Long total;


    public PageVo(Page page) {

        this.totalPages = page.getTotalPages();
        this.number = page.getNumber();
        this.size = page.getSize();
        this.total=page.getTotalElements();
    }
}
